﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Lepton_Practical_MVVM_6_1.ViewModels {
    internal class ShellViewModel : INotifyPropertyChanged {

        public ShellViewModel() {
            generateTestData();
        }

        private void generateTestData() {
            Services.MenuService ms = new Services.MenuService(this);
            ms.RegisterMenu("abc", null, null, new Uri("pack://application:,,,/Img/lepton.gif"));
            ms.RegisterMenu("abc-1", "abc", null);
            ms.RegisterMenu("abc-1-1", "abc-1", typeof(System.Windows.Controls.UserControl));
            ms.RegisterMenu("abc-2", "abc", typeof(System.Windows.Controls.UserControl));
            ms.RegisterMenu("abc-3", "abc", typeof(System.Windows.Controls.UserControl));
            ms.RegisterMenu("def", null, typeof(System.Windows.Controls.UserControl), new Uri("pack://application:,,,/Img/silverlight.png"));
        }

        private Models.MyMenuItem _MainMenu =
            new Models.MyMenuItem();
        /// <summary>
        /// 主菜单
        /// </summary>
        public Models.MyMenuItem MainMenu {
            get {
                return _MainMenu;
            }
            set {
                _MainMenu = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("MainMenu"));
            }
        }



        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }
}
